<template>
    <div>
        <p ref="myRef" @click="fn">获取当前实例</p>
        <myChildren ref="myChild"></myChildren>
    </div>
</template>

<script setup>
import myChildren from './myChildren.vue';
import { ref } from 'vue';
const myRef = ref(null)


const myChild = ref(null)
const fn = () => {
    console.log( myChild.value.num);
    // myRef.value.innerText = 'haha'
}
</script>

<style lang="scss" scoped>

</style>